package com.changgou.service.goods.controller;

import com.changgou.common.pojo.Result;
import com.changgou.common.pojo.StatusCode;
import com.changgou.service.goods.service.SpecService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Author: Bytezero_zhengLei
 * @Date: 2024/8/26 21:15
 * @Project_Name:
 * @Email: 420498246@qq.com
 * @Description:
 * @TODO:
 */

//@RequestMapping("/brand")
@RestController
public class SpecController {

    @Resource
    private SpecService specService;
    /**
     * 根据商品分类名称查询规格列表
     *
     * @param category
     * @return
     */
    @GetMapping("/category/{category}")
    public Result findListByCategoryName(@PathVariable String category) {
        List<Map> specList = specService.findListByCategoryName(category);
        return new Result(true, StatusCode.OK, "", specList);
    }
}
